// 2025/11/6
// 删除有序数组中的重复项

class Solution {
public:
    int removeDuplicates(vector<int>& nums) {
        int l = 0, r = 1, n = nums.size();
        for(r = 1; r < n; r++)
        {
            if(nums[r] != nums[l])
                nums[++l] = nums[r];
        }
        return l + 1;
    }
};